#define DEBUG
#include <cstdio>

using namespace std;

const int maxn=2000, maxm=2000;

int min(int a, int b) {
	return a<b ? a : b;
}

class Graph {
	public:
		int n, m, side[maxn+1][maxn+1], dfn[maxn+1], minf[maxn+1];

		void addSide(int u, int v) {
			side[u][++side[u][0]] = v;
		}

		void delSide(int u, int v) {
			bool flag=false;
			for (int i=1; i<=side[u][0]; i++) {
				if (flag) {
					side[u][i-1] = side[u][i];
				} else if (side[u][i]==v) {
					flag = true;
				}
			}
			if (flag) {
				side[u][0]--;
			}
		}

		int getBridge(int o, int fa) {
			static bool book[maxn+1];
			minf[o] = dfn[o] = ++dfn[0];
			book[o] = true;
			int ret=0;
			for (int i=1; i<=side[o][0]; i++) {
				if (side[o][i]!=fa) {
					if (!book[side[o][i]]) {
						ret += getBridge(side[o][i], o);
						if (dfn[side[o][i]]==minf[side[o][i]]) {
							ret++;
						}
					}
					minf[o] = min(minf[o], minf[side[o][i]]);
				}
			}
			book[o] = false;
			return ret;
		}
};

int main() {
	freopen("graph.in", "r", stdin);
	freopen("graph.out", "w", stdout);

	static Graph g;
	int n, m, q;
	scanf("%d %d %d", &n, &m, &q);
	for (int i=1; i<=m; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		g.addSide(u, v);
		g.addSide(v, u);
	}

	g.dfn[0] = 0;
	printf("%d\n", g.getBridge(1, 0));
	for (int i=1; i<=q; i++) {
		int p, u, v;
		scanf("%d %d %d", &p, &u, &v);
		if (p==1) {
			g.addSide(u, v);
			g.addSide(v, u);
		} else {
			g.delSide(u, v);
			g.delSide(v, u);
		}
		g.dfn[0] = 0;
		printf("%d\n", g.getBridge(1, 0));
	}

	fclose(stdin);
	fclose(stdout);
	return 0;
}
